<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title>现场投票</title>
    <link rel="stylesheet" type="text/css" href="../addons/jy_h5game/resource/xianchang/css/basic.css">
	 <script type="text/javascript">
	var SCENE_INFO = {
        "title": "{$xianchang['title']}",
        "top_title": "{php echo json_encode($basic_config['top_title'])}",
        "top_font_size": "{$basic_config['top_font_size']}",
        "memo": "{$basic_config['title']}",
        "top_img": "{php echo tomedia($basic_config['top_img'])}",
        "bg_img": "{php echo tomedia($basic_config['bg_img'])}",
        "bottom_img": "{php echo tomedia($basic_config['bottom_img'])}",
        "diy_css": "{$basic_config['diy_css']}",
        "keyword": "{$basic_config['title']}",
        "mp_username": "{$basic_config['mp_name']}",
        "func": {
          "wall": "1",
          "lottery": "1",
          "shake": "1"
        },
        "navbar": {
          "wall": "1",
          "lottery": "1",
          "lottery_free": "1",
          "shake": "1",
          "shake_free": "1"
        }
      };
      var WALL_INFO = {
        "id": "{$rid}",
        "scene_id": "{$rid}",
        "title": "{$wall_config['title']}",//网页顶部标题
        "show_style": "{$wall_config['show_style']}",//滚动 或者 翻转
        "show_type": "{$wall_config['show_type']}",//最新不循环或者随机循环
        "re_time": "{$wall_config['re_time']}",
        "chistory": "{$wall_config['chistory']}",
		"show_big":"{$wall_config['show_big']}",
		"show_big_time":"{$wall_config['show_big_time']}"
      };
	  var PATH_URL = "../addons/jy_h5game/resource/xianchang/images/piao/";
	  var show_msg_2=null;
	  var check_msg=null;
	  {if $bd_config['show']==1}
		  var bd_show = 1;
		  var lottory_show = {php echo json_encode($lottory_show)}||[];
	  {else}
		var bd_show = 0;
	  {/if}
	  </script>
	  <style>
		#show_hide_nav{width: 100%;position: fixed;bottom: -10px;text-align: center;z-index:9998}	
		.Panel.Top{z-index:1}
	  </style>
	<script src="../addons/jy_h5game/resource/xianchang/js/tool.js" type="text/javascript" charset="utf-8"></script>
    <script src="../addons/jy_h5game/resource/xianchang/js/jquery-2.0.3.min.js" type="text/javascript" charset="utf-8"></script>
	<style>
		.lottery-right{z-index:10}
	</style>

<link rel="stylesheet" type="text/css" href="../addons/jy_h5game/resource/xianchang/css/screen_wall.css">
{if $vote['show_style']==1}
<link rel="stylesheet" type="text/css" href="../addons/jy_h5game/resource/xianchang/css/votecss1.css?T=1" media="all">
{else}
<link rel="stylesheet" type="text/css" href="../addons/jy_h5game/resource/xianchang/css/votecss2.css?T=1" media="all">
{/if}
<style type="text/css">

.round-welcome {
 display:none; 
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 91%;
z-index: 99999;
background-color: rgba(0, 0, 0, 0.9);
}
.round-welcome .label .activity_key {
color: #f6ff27;
padding: 0 4px;
font-weight: bold;
}
.round-welcome img {
width: 430px;
height: 430px;
position: absolute;
left: 50%;
top: 50%;
margin-top: -215px;
margin-left: -215px;
border-radius: 15px;
box-shadow: 0 10px 10px #000;
}
.round-label {
position: absolute;
width: 128px;
height: 64px;
background: url(../addons/jy_h5game/resource/xianchang/images/vote.png) top center no-repeat;
padding: 80px 0 0 0;
text-align: center;
font-size: 25px;
color: #fff;
top: 50%;
margin-top: -72px;
left: 50%;
margin-left: -420px;
cursor: default;
font-weight: bold;
}

.button-start {
position: absolute;
width: 128px;
height: 64px;
background: url(../addons/jy_h5game/resource/xianchang/images/start.png) top center no-repeat;
padding: 80px 0 0 0;
text-align: center;
font-size: 25px;
color: #fff;
top: 50%;
margin-top: -72px;
right: 50%;
margin-right: -420px;
cursor: pointer;
}
.round-welcome .label {
position: absolute;
color: #fff;
line-height: 70px;
text-align: center;
font-size: 35px;
width: 100%;
}
.round-welcome .label.bottom {
bottom: 0;
}
.votebody h2{     font-size: 20px;
    padding: 15px 0;
    color: #FFF;
    text-align: center;
    font-weight: normal;
    position: absolute;
    width: 100%;}
.lunci{ display: block;
margin: 0 auto;
text-align: center;
position: absolute;
width: 100%;
bottom: 10px;}
.lunci a{display: inline-block;
padding: 5px 10px;
border: 1px solid rgba(255, 255, 255, 0.45);
font-size: 14px;
color: rgba(255, 255, 255, 0.65);
margin-right: 10px;
border-radius: 10px;}
.lunci a:hover{     border: 1px solid rgba(255, 255, 255, 0.7);
    background-color: rgba(255, 255, 255,0.5);
color:  #000;}
.lunci a.active{     border: 1px solid rgba(255, 255, 255, 0.7);
    background-color: rgb(255, 255, 255);
color:  #000;}

.lunci a.end{ border: 2px solid rgba(255, 255, 255, 0.5);
background-color: rgba(255, 255, 255, 0.5) ;
color:  #000;
font-size: 16px;}

</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="../addons/jy_h5game/resource/xianchang/js/base3.js" type="text/javascript" charset="utf-8"></script>
<script src="../addons/jy_h5game/resource/xianchang/js/jquery_flexslider.js" type="text/javascript"></script>
<script src="../addons/jy_h5game/resource/xianchang/js/audio.js" type="text/javascript"></script>
<script src="../addons/jy_h5game/resource/xianchang/js/screen_photo.js" type="text/javascript" charset="utf-8"></script>
</head>
<div class="Panel MsgList" style="display: block;opacity: 1;">
<div class="votebody" id="container">
   <h2>{$vote['vote_zhuti']}</h2>
   <div  class="votebox">{if $vote['status']!=2}<div class="voteend open" state="2" ></div>{else}<div class="votestart open" state="1"></div>{/if}</div>
 <div class="votekkk">  
    <ul class="toupiao">
	
    {if $vote['show_style']==1}
		{loop $vote_xms $row}
		{if $total==0 && $row['nums']==0}{php $total=1}{/if}
		<li >
			<div class="progress-bar   stripes">
			<span  id="vote{$row['id']}" style="height: {php echo  sprintf("%.2f", ($row['nums']/$total)*100 )}%" data-value="{php echo  sprintf("%.2f", ($row['nums']/$total)*100 )}%"></span>
			<p class="title">{$row['name']}</p>
			<p  id="nums{$row['id']}" class="title2">{$row['nums']}票</p>
			</div>
		</li>
		{/loop}
	{else}
	 <div  class="libox">
			{loop $vote_xms $row}
			{if $total==0 && $row['nums']==0}{php $total=1}{/if}
			<li> 
			{if !empty($row['img'])}<img src="{php echo tomedia($row['img'])}"   height="100" >{/if}
			<p class="title">{$row['name']} ( <b  id="nums{$row['id']}" class="title2">{$row['nums']}票</b> )</p>
			<div class="progress-bar    stripes"  {if empty($row['img'])}style="margin-left:0px;"{/if}> <span  id="vote{$row['id']}" style="width: {php echo  sprintf("%.2f", ($row['nums']/$total)*100 )}%" data-value="{php echo  sprintf("%.2f", ($row['nums']/$total)*100 )}%"></span>
			</div>
			</li>        
			{/loop}
	 </div> 
	{/if}
  </ul>
</div>
	<div class="lunci"> 
	{loop $votes $key $row}
	<a href="{$row['url']}"   class="{if $vote['id']==$row['id']}active{/if}">第{php echo $key+1}轮</a> 
	{/loop}
	</div>
</div>
</div>
<script src="../addons/jy_h5game/resource/xianchang/js/screenfull.js" type="text/javascript"></script>
<script>
var f=false;
var idd;
$(function () {
$('.fullscreen').click(function () {
if(!f){
	screenfull.request($('#container')[0]);
	//$('.MsgList').css({"height":"100%","width":"100%"});

	f = true;
}else{
	f = false;
	//$('.MsgList').css({"height":"74%","width":"90%"});
	screenfull.exit();
}
});
$('#exit').click(function () {
	screenfull.exit();
});
$(document).on(screenfull.raw.fullscreenchange, function () { 
	if (!screenfull.isFullscreen) {
		 f = false;
		 $('.votebody').css({"background-image":"","background-attachment":"inherit",
		"background-size":"cover",
		"-webkit-background-size":"cover",
		"background-position":"50% 50%",
		"background-repeat":"no-repeat no-repeat",
		"background-color":"#305412 !important",
		"display":" block"});
		// alert('退出全屏');
	}else{
		 f = true;
		 $('.votebody').css({"background-image":"url({if empty($basic_config['bg_img'])}{if $basic_config['basic_style']!=35 && !empty($basic_config['basic_style'])}{MODULE_URL}template/mobile/app/style/all/{if strlen($basic_config['basic_style'])==1}00{else}0{/if}{$basic_config['basic_style']}d.{if $basic_config['basic_style']!='23'}jpg{else}gif{/if}{else}{MODULE_URL}template/mobile/app/style/all/035d.jpg{/if}{else}{php echo tomedia($basic_config['bg_img']);}{/if})","background-attachment":"inherit",
		"background-size":"cover",
		"-webkit-background-size":"cover",
		"background-position":"50% 50%",
		"background-repeat":"no-repeat no-repeat",
		"background-color":"#305412 !important",
		"display":" block"});
	}
});
});
</script>
<script>
$(".open").on("click",  function() {
	if($(".open").attr("state")=="2"){
		$(".open").attr("state","1");
		$(".open").removeClass("voteend");
		$(".open").addClass("votestart");
		$.getJSON(PATH_ACTIVITY + Path_url('vote_start'), {
                rid: scene_id,
                vote_id:"{$vote_id}"
            });
		window.clearInterval(idd);
		idd=window.setInterval(getjson,2000);
	}else{
 
		$(".open").attr("state","2");
		$(".open").removeClass("votestart");
		$(".open").addClass("voteend");
		$.getJSON(PATH_ACTIVITY + Path_url('vote_end'), {
                rid: scene_id,
                vote_id:"{$vote_id}"
            });
           // idd=window.setInterval(getjson,2000);
				window.clearInterval(idd);
		}
});
function getjson(){ 
//[{"id":"5","vote":16,"votes":"70"},{"id":"6","vote":72,"votes":"314"},{"id":"7","vote":11,"votes":"49"}]
	$.getJSON(PATH_ACTIVITY + Path_url('vote_json'), {
                rid: scene_id,
                vote_id:"{$vote_id}"
            },function(result){
		  $.each(result, function(i,val){
			  {if $vote['show_style']==1}
				$("#vote"+result[i].id).css('height',result[i].per+'%');
			  {else}
				$("#vote"+result[i].id).css('width',result[i].per+'%');
			  {/if}
				$("#vote"+result[i].id).attr("data-value",result[i].per+'%');
				$("#nums"+result[i].id).text(result[i].nums+'票');
		  });
	});
} 
{if $vote['status']==2}
	window.clearInterval(idd);
	idd=window.setInterval(getjson,2000);
{/if}
</script>
</body>
</html>